package info.niwota.start;

import android.content.Context;
import android.database.Cursor;
import android.net.Uri;


public class Utils {
	private static final String[] DATA_PATH_PROJECTION = new String[] { "_data" };

	public static String getDataPath(Context context, Uri uri) {
		Cursor c = null;
		try {
			c = context.getContentResolver().query(uri, DATA_PATH_PROJECTION,
					null, null, null);
			if (c != null && c.moveToFirst()) {
				return c.getString(0);
			} else {
				return null;
			}
		} finally {
			if (c != null)
				c.close();
		}
	}
}
